package com.zr.util;

import lombok.Data;

/**
 * Created by 非常狂躁的猪 on 2019/12/20.
 */
@Data
public class ResultBuilderVo<T> {
    public static <T> ResultVo success(T date){
        ResultVo resultVo = new ResultVo();
        resultVo.setData(date);
        resultVo.setSuccess(true);
        return  resultVo;
    }

    public static <T> ResultVo success(){
        ResultVo resultVo = new ResultVo();
        resultVo.setData(null);
        resultVo.setSuccess(true);
        return resultVo;
    }

    public static ResultVo error(String errorMessage){
        ResultVo resultVo = new ResultVo();
        resultVo.setErrorMessage(errorMessage);
        resultVo.setSuccess(false);
        return resultVo;
    }


}
















































